<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
class Incremento extends AppModel {
    public $useTable = 'incremento';
    
     public function regresaBase(){
        return $this->getDataSource();
    } 
    public function regresaTodos()
    {
        $t = $this->find('all',array(
            'order' => 'id ASC',
            'callbacks' => false,
          ));
        $todos = array();
        for($i = 0;$i<count($t);$i++)
            $todos[$i]=$t[$i]['Incremento'];
        return $todos;
    }  
    public function ultimoId()
    {
        $id = $this->find('first',array(
            'fields' => 'id',
            'order' => 'id DESC',
            'callbacks' => false,
          ));
        $id = $id['Incremento']['id'];
        return $id;
    }
}
?>
